package com.swu.pad.comment.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.swu.pad.comment.entity.FbComment;

public interface FbCommentDao extends JpaRepository<FbComment, String> {

	/**
	 * 根据作者ID获取评论列表
	 * @param authorId
	 * @return
	 */
	public List<FbComment> findFbCommentByAuthorId(String authorId);
	public List<FbComment> findFbCommentByAuthorIdAndPadId(String authorId,String padId);
	public List<FbComment> findFbCommentByAuthorIdAndAssignmentId(String authorId,String assignmentId);
	
	/**
	 * by zdb add
	 * @param commenterId
	 * @param assignmentId
	 * @return
	 */
	public List<FbComment> findFbCommentByCommenterIdAndAssignmentId(String commenterId,String assignmentId);
	public List<FbComment> findFbCommentByAuthorIdAndCommenterIdAndAssignmentId(String authorId,String commenterId,String assignmentId);
	public List<FbComment> findFbCommentByCommentIdAndAssignmentId(String commentId,String assignmentId);
	public List<FbComment> findFbCommentByCommentTextAndCommenterIdAndAssignmentId(String commentText,String commenterId,String assignmentId);
    public List<FbComment> findFbCommentByCommentTextAndCommenterIdAndAssignmentIdAndActivityId(String commentText,String commenterId,String assignmentId,String activityId);
	public List<FbComment> findFbCommentByAuthorIdAndAssignmentIdAndActivityId(String commentId,String assignmentId,String activityId);
	
	public List<FbComment> findFbCommentByAuthorIdAndCommenterIdAndAssignmentIdAndActivityId(String authorId,String commenterId,String assignmentId,String activityId);
	public List<FbComment> findFbCommentByCommentIdAndAssignmentIdAndActivityId(String commenterId,String assignmentId,String activityId);
	/**
	 * 根据评论者ID获取评论列表
	 * @param commenterId
	 * @return
	 */
	public List<FbComment> findFbCommentByCommenterId(String commenterId);
	public List<FbComment> findFbCommentByCommenterIdAndPadId(String commenterId,String padId);

	/**
	 * 根据类型获取评论列表
	 * @param type
	 * @return
	 */
	public List<FbComment> findByTypeAndAuthorId(String type, String authorId);
	public List<FbComment> findByFeedbackTypeAndAuthorIdAndPadId(String feedbackType, String authorId,String padID);

	public List<FbComment> findByPadId(String padId);

	public List<FbComment> findByPadIdAndType(String padId, String type);

	public List<FbComment> findByPadIdAndTypeAndAuthorIdAndCommenterId(String padId, String type, String authorId, String commenterId);
	public List<FbComment> findFbCommentByAuthorIdAndFeedbackTypeAndActivityId(
			String userId, String string, String activityId);
	public List<FbComment> findFbCommentByCommentIdAndFeedbackType(
			String commentId, String string);
	
	
	/**
	 * 查询评论数据
	 * @param userId
	 * @param type
	 * @return
	 */
	public List<FbComment> findFbCommentByAuthorIdAndFeedbackTypeAndAssignmentId(String userId, String type,String assignmentId);
	public List<FbComment> findFbCommentByCommenterIdAndFeedbackTypeAndAssignmentId(String userId, String type,String assignmentId);
	public List<FbComment> findFbCommentByCommenterIdAndFeedbackTypeAndActivityId(String userId, String type,String activityId);
	public List<FbComment> findFbCommentByCommentIdAndFeedbackTypeAndActivityId(
			String commentId, String type,String activityId);
}